const AutoTrader = require('../classes/AutoTrader')

const trader = new AutoTrader({
    exchangeId: 'okex',
    apiKey: 'a3325d39-8538-40f6-ad3c-3bfd66f94597',
    secret: 'B22D0E0A46A9E51EB1E30D61B49779C5',
    tick: 'BTC/USDT',
    transactionType: 'futures',
    rsiUpper: 75,
    rsiLower: 25,
    stochRsiUpper: 95,
    stochRsiLower: 5,
    minBollWidth: 300,
    loopDuration: 5000,
    minutesAfterLoss: 10
})

trader.start()

process.on('uncaughtException', (e)=>{
    console.log(e)
    process.exit(1)
})

process.on('unhandledRejection',function(err,promise){
  console.log(err)
  process.exit(1)
  //监听Promise没有被捕获的失败函数    
})